Optimal. Leaf size=376 \[ \frac{C (a+b \tan (e+f x))^{m+1} (c+d \tan (e+f x))^n \left (\frac{b (c+d \tan (e+f x))}{b c-a d}\right )^{-n} \text{Hypergeometric2F1}\left (m+1,-n,m+2,-\frac{d (a+b \tan (e+f x))}{b c-a d}\right )}{b f (m+1)}-\frac{(B+i (A-C)) (a+b \tan (e+f x))^{m+1} (c+d \tan (e+f x))^n \left (\frac{b (c+d \tan (e+f x))}{b c-a d}\right )^{-n} F_1\left (m+1;-n,1;m+2;-\frac{d (a+b \tan (e+f x))}{b c-a d},\frac{a+b \tan (e+f x)}{a-i b}\right )}{2 f (m+1) (a-i b)}-\frac{(A+i B-C) (a+b \tan (e+f x))^{m+1} (c+d \tan (e+f x))^n \left (\frac{b (c+d \tan (e+f x))}{b c-a d}\right )^{-n} F_1\left (m+1;-n,1;m+2;-\frac{d (a+b \tan (e+f x))}{b c-a d},\frac{a+b \tan (e+f x)}{a+i b}\right )}{2 f (m+1) (-b+i a)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.899859, antiderivative size = 376, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 6, integrand size = 45, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.133, Rules used = {3655, 6725, 70, 69, 137, 136} \[ -\frac{(B+i (A-C)) (a+b \tan (e+f x))^{m+1} (c+d \tan (e+f x))^n \left (\frac{b (c+d \tan (e+f x))}{b c-a d}\right )^{-n} F_1\left (m+1;-n,1;m+2;-\frac{d (a+b \tan (e+f x))}{b c-a d},\frac{a+b \tan (e+f x)}{a-i b}\right )}{2 f (m+1) (a-i b)}-\frac{(A+i B-C) (a+b \tan (e+f x))^{m+1} (c+d \tan (e+f x))^n \left (\frac{b (c+d \tan (e+f x))}{b c-a d}\right )^{-n} F_1\left (m+1;-n,1;m+2;-\frac{d (a+b \tan (e+f x))}{b c-a d},\frac{a+b \tan (e+f x)}{a+i b}\right )}{2 f (m+1) (-b+i a)}+\frac{C (a+b \tan (e+f x))^{m+1} (c+d \tan (e+f x))^n \left (\frac{b (c+d \tan (e+f x))}{b c-a d}\right )^{-n} \, _2F_1\left (m+1,-n;m+2;-\frac{d (a+b \tan (e+f x))}{b c-a d}\right )}{b f (m+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3655
Rule 6725
Rule 70
Rule 69
Rule 137
Rule 136
Rubi steps
\begin{align*} \int (a+b \tan (e+f x))^m (c+d \tan (e+f x))^n \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{(a+b x)^m (c+d x)^n \left (A+B x+C x^2\right )}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (C (a+b x)^m (c+d x)^n+\frac{(-B+i (A-C)) (a+b x)^m (c+d x)^n}{2 (i-x)}+\frac{(B+i (A-C)) (a+b x)^m (c+d x)^n}{2 (i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(-B+i (A-C)) \operatorname{Subst}\left (\int \frac{(a+b x)^m (c+d x)^n}{i-x} \, dx,x,\tan (e+f x)\right )}{2 f}+\frac{(B+i (A-C)) \operatorname{Subst}\left (\int \frac{(a+b x)^m (c+d x)^n}{i+x} \, dx,x,\tan (e+f x)\right )}{2 f}+\frac{C \operatorname{Subst}\left (\int (a+b x)^m (c+d x)^n \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\left ((-B+i (A-C)) (c+d \tan (e+f x))^n \left (\frac{b (c+d \tan (e+f x))}{b c-a d}\right )^{-n}\right ) \operatorname{Subst}\left (\int \frac{(a+b x)^m \left (\frac{b c}{b c-a d}+\frac{b d x}{b c-a d}\right )^n}{i-x} \, dx,x,\tan (e+f x)\right )}{2 f}+\frac{\left ((B+i (A-C)) (c+d \tan (e+f x))^n \left (\frac{b (c+d \tan (e+f x))}{b c-a d}\right )^{-n}\right ) \operatorname{Subst}\left (\int \frac{(a+b x)^m \left (\frac{b c}{b c-a d}+\frac{b d x}{b c-a d}\right )^n}{i+x} \, dx,x,\tan (e+f x)\right )}{2 f}+\frac{\left (C (c+d \tan (e+f x))^n \left (\frac{b (c+d \tan (e+f x))}{b c-a d}\right )^{-n}\right ) \operatorname{Subst}\left (\int (a+b x)^m \left (\frac{b c}{b c-a d}+\frac{b d x}{b c-a d}\right )^n \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{(B+i (A-C)) F_1\left (1+m;-n,1;2+m;-\frac{d (a+b \tan (e+f x))}{b c-a d},\frac{a+b \tan (e+f x)}{a-i b}\right ) (a+b \tan (e+f x))^{1+m} (c+d \tan (e+f x))^n \left (\frac{b (c+d \tan (e+f x))}{b c-a d}\right )^{-n}}{2 (a-i b) f (1+m)}-\frac{(A+i B-C) F_1\left (1+m;-n,1;2+m;-\frac{d (a+b \tan (e+f x))}{b c-a d},\frac{a+b \tan (e+f x)}{a+i b}\right ) (a+b \tan (e+f x))^{1+m} (c+d \tan (e+f x))^n \left (\frac{b (c+d \tan (e+f x))}{b c-a d}\right )^{-n}}{2 (i a-b) f (1+m)}+\frac{C \, _2F_1\left (1+m,-n;2+m;-\frac{d (a+b \tan (e+f x))}{b c-a d}\right ) (a+b \tan (e+f x))^{1+m} (c+d \tan (e+f x))^n \left (\frac{b (c+d \tan (e+f x))}{b c-a d}\right )^{-n}}{b f (1+m)}\\ \end{align*}
Mathematica [F] time = 22.7369, size = 0, normalized size = 0. \[ \int (a+b \tan (e+f x))^m (c+d \tan (e+f x))^n \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.649, size = 0, normalized size = 0. \begin{align*} \int \left ( a+b\tan \left ( fx+e \right ) \right ) ^{m} \left ( c+d\tan \left ( fx+e \right ) \right ) ^{n} \left ( A+B\tan \left ( fx+e \right ) +C \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) \, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (C \tan \left (f x + e\right )^{2} + B \tan \left (f x + e\right ) + A\right )}{\left (b \tan \left (f x + e\right ) + a\right )}^{m}{\left (d \tan \left (f x + e\right ) + c\right )}^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (C \tan \left (f x + e\right )^{2} + B \tan \left (f x + e\right ) + A\right )}{\left (b \tan \left (f x + e\right ) + a\right )}^{m}{\left (d \tan \left (f x + e\right ) + c\right )}^{n}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (C \tan \left (f x + e\right )^{2} + B \tan \left (f x + e\right ) + A\right )}{\left (b \tan \left (f x + e\right ) + a\right )}^{m}{\left (d \tan \left (f x + e\right ) + c\right )}^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]